/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
 * Projects
 * Copyright (C) Arnaud Duval 2010 <arnaud.duval@gmail.com>
 * 
 * Projects is free software: you can redistribute it and/or modify it
 * under the terms of the GNU General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Projects is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef _DATE_SELECTION_DIALOG_HPP_
#define _DATE_SELECTION_DIALOG_HPP_

#include <gtkmm.h>
#include <DateTime.hpp>


///@class DateSelectionDialog
///@brief Dialog box for editing an activity
class DateSelectionDialog : public Gtk::Dialog
{
    public:
        ///@brief Constructor
        DateSelectionDialog(Gtk::Window *parent);
        ///@brief Destructor
        virtual ~DateSelectionDialog();
        ///@brief Return selected date
        DateTime GetDate();
        ///@brief Set the displayed date
        void SetDate(DateTime);
        ///@brief Decrease the year value
        void DecreaseYear();
        ///@brief Increase the year value
        void IncreaseYear();
        ///@brief Descrease the month value
        void DecreaseMonth();
        ///@brief Increase the month value
        void IncreaseMonth();
        ///@brief Update displayed data
        void UpdateDisplay();
    protected:
        ///@brief Action when clicking on next year label
        void on_next_year_clicked();
        ///@brief Action when clicking on previous year label
        void on_prev_year_clicked();
        ///@brief Action when clicking on next month label
        void on_next_month_clicked();
        ///@brief Action when clicking on previous month label
        void on_prev_month_clicked();
        ///@brief Action when clicking on a date button
        void on_date_clicked(unsigned int);

    private:
        ///@brief Selected date
        DateTime theDate;

        Gtk::Label yearLabel;
        Gtk::Label monthLabel;
        Gtk::Button nextYearButton;
        Gtk::Button prevYearButton;
        Gtk::Button nextMonthButton;
        Gtk::Button prevMonthButton;

        Gtk::HBox yearHBox;
        Gtk::HBox monthHBox;

        Gtk::Table daysTable;
        Gtk::Label daysNameLabels[7];
        Gtk::Button daysNumberButtons[31];
};

#endif // _DATE_SELECTION_DIALOG_HPP_
